# Contributor: Clayton Craft <clayton@craftyguy.net>
# Maintainer: Clayton Craft <clayton@craftyguy.net>
pkgname=wys
pkgver=0.1.7
pkgrel=0
pkgdesc="A daemon to bring up and take down PulseAudio loopbacks for phone call audio."
arch="all"
url="https://source.puri.sm/Librem5/wys"
license="GPL-3.0-or-later"
makedepends="meson pulseaudio-dev glib-dev modemmanager-dev"
source="
	$pkgname-$pkgver.tar.gz::https://source.puri.sm/Librem5/wys/-/archive/v$pkgver/wys-v$pkgver.tar.gz
	wys.desktop"
builddir=$srcdir/$pkgname-v$pkgver

build() {
	meson \
		-Dprefix=$pkgdir/usr \
		-Dsysconfdir=$pkgdir/etc \
		-Dmandir=share/man \
		-Dlocalstatedir=$pkgdir/var \
		-Dbuildtype=plain \
		build

	ninja -C ./build
}

check() {
	ninja -C ./build test
}

package() {
	mkdir -p $pkgdir
	ninja -C $builddir/build install
	install -D -m644 $srcdir/wys.desktop $pkgdir/etc/xdg/autostart/wys.desktop
}

sha512sums="81a9f97cced2ceee0823bf3e45bb8fd6b79d8ae6d8fb1b459f8a5e24ebde0884899924c5af601466317ff397246028aafeec97504179f54c78e83eee7f322437  wys-0.1.7.tar.gz
0f67c24d9af727e803d5cdb2dc01c7d99a2bfe33414fdc29cf5ec34c5a308b3a5f65970832087310e25e4ba7dc706b5a1d1ae99ab595d7264e972047a08f71e4  wys.desktop"
